package learningThread.api.currentThreadApi;

public class MyThread extends Thread{

    private int i;

    /**
     * 当前线程被主线程调用，名称取自super的名字
     * @param i
     * @param name
     */
    public MyThread(int i, String name){
        super(name);
        System.out.println("构造MyThread时的当前线程为:"+Thread.currentThread().getName());
        this.i = i;
        System.out.println("this.getName:"+this.getName());
    }

    @Override
    public void run() {
        System.out.println("执行MyThread时的当前线程run方法的线程:"+Thread.currentThread().getName());
        System.out.println("继承至Thread类");
        System.out.println("this.getName:"+this.getName());
    }
}
